package com.example.ymm.modules1.mapper.my.user;

import com.example.ymm.base.CoreMapper;
import com.example.ymm.modules1.entity.my.user.DbUserNote;
import com.example.ymm.modules1.service.dto.BookPieDto;
import com.example.ymm.modules1.service.dto.DbUserNoteQueryCriteria;
import com.example.ymm.modules1.service.dto.SysRankingListDto;
import com.example.ymm.modules1.service.dto.SysRankingQueryCriteria;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;

import java.math.BigDecimal;
import java.util.List;

@Repository
@Mapper
public interface DbUserNoteMapper extends CoreMapper<DbUserNote> {

    BigDecimal getUserDurations(DbUserNoteQueryCriteria criteria);

    DbUserNote getNewUserNote(DbUserNoteQueryCriteria criteria);


    List<BookPieDto> bookPieCount(SysRankingQueryCriteria criteria);

    List<String> bookPieUserList(DbUserNoteQueryCriteria criteria);

    /**
     * 统计读书人数
     * @param criteria
     * @return
     */
    Integer userNumCount(SysRankingQueryCriteria criteria);

    /**
     * 统计读书人次
     * @param criteria
     * @return
     */
    Integer userFrequencyCount(SysRankingQueryCriteria criteria);


    /**
     * 统计读书时长
     * @param criteria
     * @return
     */
    Double userTimeCount(SysRankingQueryCriteria criteria);


    /**
     * 电脑排行榜
     * @param criteria
     * @return
     */
    List<SysRankingListDto> sysRankingList(SysRankingQueryCriteria criteria);

}